'use strict';


let Koa = require('koa');
let bodyParser = require('koa-bodyparser');

let controller = require('./controllers');

let staticRes = require('koa-static');

let templating = require('./templating');
let model = require('./models');

let session=require('./session');


let app = new Koa();


 app.use(session(app));


app.use(staticRes(__dirname));


app.use(bodyParser());


app.use(templating);


app.use(controller());


(async ()=>{
    console.log('正在初始化数据表。。。');
//await model.sync();
})();


let port = 3000;
app.listen(port);


console.log(`http://127.0.0.1:${port}`);


